package web.study.tag;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.Tag;
import javax.servlet.jsp.tagext.TagSupport;

public class LocalPageTag extends TagSupport
{
    /**
     * 序列化
     */
    private static final long serialVersionUID = 1L;
    
    @Override
    public int doEndTag()
        throws JspException
    {
        String remoteAddr = pageContext.getRequest().getRemoteAddr();
        if (remoteAddr.equals("127.0.0.1"))
        {
            return Tag.EVAL_PAGE;
        }
        else
        {
            return Tag.SKIP_PAGE;
        }
    }
}
